package com.smile.frame.websocket.netty.service.enums;

import lombok.Getter;

/**
 * 指令枚举
 *
 * @author LGC
 */
@Getter
public enum CmdEnum {

    /**
     *
     */
    AUTH("auth", "auth"),

    PING("ping", "ping"),
    PONG("pong", "pong"),
    DATA("data", "响应数据"),

    ;

    private final String code;
    private final String info;

    CmdEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static CmdEnum getCmdEnumByCode(String code) {
        for (CmdEnum e : CmdEnum.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }
}
